package com.wqc.config;

import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.rabbit.connection.CorrelationData;
import org.springframework.amqp.rabbit.core.RabbitTemplate;

/**
 * @author wqc
 * @version 1.0
 * @description: TODO
 * @date 2021-12-7 16:12
 */
public class RabbitConfirmCallback implements RabbitTemplate.ConfirmCallback {

    @Override
    public void confirm(CorrelationData correlationData, boolean ack, String cause) {
        System.out.println("(start)生产者消息确认=========================");
        System.out.println("correlationData:"+correlationData);
        System.out.println("ack:"+ ack);
        System.out.println("cause:"+cause);
        if (!ack) {
            System.out.println("消息可能未到达rabbitmq服务器");
        }
        System.out.println("(end)生产者消息确认=========================");
    }
}
